﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Manage_NoVerifyArticle : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string aid = Request.Params["aid"];
            ArticleID.Value = aid;

            try
            {
                CmsDataContext db = new CmsDataContext();
                Article article = (from aA in db.Article
                                   where aA.ID == aid
                                   select aA).First();

                Description.Text = article.Thumbnail.Trim();
            }
            catch
            {
            }
        }
    }
    protected void Save_Click(object sender, EventArgs e)
    {
        string aid = ArticleID.Value.Trim();

        try
        {
            CmsDataContext db = new CmsDataContext();
            Article article = (from aA in db.Article
                               where aA.ID == aid
                               select aA).First();
            article.Thumbnail = Description.Text.Trim();
            db.SubmitChanges();

            MessageBox.Message = "已经成功保存未通过审核的原因。";
            MessageBox.Location = "./NoVerifyArticle.aspx?aid=" + article.ID;
        }
        catch (Exception ee)
        {
            MessageBox.Message = "保存未通过审核的原因时发生错误：" + ee.Message;
        }
    }
}